package com.tikou.buildvariants;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

import com.meituan.android.walle.WalleChannelReader;

public class MainActivity extends AppCompatActivity {
    private TextView tv_package,tv_Env,tv_channel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv_package=findViewById(R.id.tv_package);
        tv_Env=findViewById(R.id.tv_envType);
        tv_channel=findViewById(R.id.tv_channel);
        initView();
    }

    private void initView() {
        String channel= WalleChannelReader.getChannel(this.getApplicationContext());
        String packageName=getPackageName();
        String envtype ="";
        int envType=BuildConfig.ENV_TYPE;
        switch (envType){
            case EnvType.DEVELOP:
                envtype ="开发环境";
                break;

            case EnvType.CHECK:
                envtype="测试环境";
                break;
            default:
                break;
        }
        tv_package.setText("channel="+channel);
        tv_channel.setText("package="+packageName);
        tv_Env.setText("Env="+envtype);
    }
}
